package com.fds.app.comm.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.fds.app.cm.dto.CodeMgtDateDto;
import com.fds.app.cm.service.CodeMgtDateService;
import com.fds.app.comm.context.Combuf;
import com.fds.app.comm.service.NvPreProcessor;
import com.fds.app.comm.util.BeanDebugUtil;

@Component
@Order(value = 3)
public class NvPreCodeMgtDateProcessor implements NvPreProcessor {
	private Logger logger = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private CodeMgtDateService codeMgtDateService;

	@Autowired
	private Combuf combuf;

	@Override
	public void init() {

	}

	@Override
	public void process() {
		logger.info("#####################################");
		logger.info(combuf.getWkymd());
		logger.info(combuf.getImc());
		logger.info(combuf.getFund());
		logger.info("#####################################");

		CodeMgtDateDto codeMgtDateDto = codeMgtDateService.forBuilder(combuf);

		BeanDebugUtil.showBeanInfo(codeMgtDateDto);

		combuf.setCodeMgtDateDto(codeMgtDateDto);
	}

	@Override
	public void finish() {

	}

}